package com.hx.pojo;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface DepRepository extends CrudRepository<DepotInfo, Integer>{
	@Query("select new com.hx.pojo.CosDep(a.depotInfoId,b.cosmeticName,b.cosmeticPrice,a.depotCount,a.inTime,a.opType,b.manufacturer) from com.hx.pojo.CosmeticInfo b inner join b.depots a")
	Page<CosDep> getDep(Pageable page);
	
	@Query("select new com.hx.pojo.CosDep(a.depotInfoId,b.cosmeticName,b.cosmeticPrice,a.depotCount,a.inTime,a.opType,b.manufacturer) from com.hx.pojo.CosmeticInfo b inner join b.depots a")
	List<CosDep> getDep();
}
